package com.yc.Matrix.row;



public class RowMultipilerTask implements Runnable{
    private final double[][] result;  //final:确保线程安全性
    private final double[][] matrix1;
    private final double[][] matrix2;
    private final int row;



    public RowMultipilerTask(double[][] result,double[][] matrix1,double[][] matrix2,int row){
        this.result=result;
        this.matrix1=matrix1;
        this.matrix2=matrix2;
        this.row=row;
    }

    @Override
    public void run(){
        for(int j=0;j<matrix2[0].length;j++){
            result[row][j]=0;
            //累加求和
            for( int k=0;k<matrix1[row].length;k++ ){
                result[row][j] += matrix1[row][k] * matrix2[k][j];
            }
        }
    }
}
